package com.chf.control;

import com.chf.Bean.UserInfoBean;
import com.chf.service.IMyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;
//表示是控制层
@Controller("LoginControl")
public class LoginControl {
    //使用属性注入进行赋值 ， 必须提供 setter 方法
    //@Autowired(以类型进行绑定)  @Resource(name,type)默认使用名字绑定，可以指定名字和类型   相同点：都能进行属性注入
    @Autowired
     UserInfoBean userInfoBean;
    //当有多个Service类时，需要指明名字
    @Resource(name = "TestService")
    IMyService myService;

    public boolean doLogin(){
        boolean bool = false;
        bool = myService.doLogin(userInfoBean);
        return bool;
    }

    public UserInfoBean getUserInfoBean() {
        return userInfoBean;
    }

    public void setUserInfoBean(UserInfoBean userInfoBean) {
        this.userInfoBean = userInfoBean;
    }

    public IMyService getMyService() {
        return myService;
    }

    public void setMyService(IMyService myService) {
        this.myService = myService;
    }
}
